package com.jyxd.web.service.zpaiban.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jyxd.web.dao.zpaiban.ZpaibanDao;
import com.jyxd.web.data.Zpaiban.ZpaibanEntity;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jyxd.web.data.Zpaiban.form.ZpaibanQueryForm;
import com.jyxd.web.service.zpaiban.ZpaibanService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ZpaibanServiceImpl extends ServiceImpl<ZpaibanDao, ZpaibanEntity> implements ZpaibanService {
    @Override
    public List<ZpaibanEntity> getByYearAndWeekNumber(ZpaibanQueryForm form) {
        if (form == null || form.getYear() == null || form.getWeekNumber() == null || form.getKeshi() == null){
            return null;
        }
        LambdaQueryWrapper<ZpaibanEntity> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZpaibanEntity::getYear, form.getYear())
                .eq(ZpaibanEntity::getWeekNumber, form.getWeekNumber())
                .eq(ZpaibanEntity::getKeshi, form.getKeshi());
        return list(lqw);
    }
}
